-
Notifications
You must be signed in to change notification settings - Fork 841
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Have "stack init" accept a list of sub-directories #1639
Conversation
where | ||
subDir = | ||
textArgument | ||
(metavar "SUB-DIRECTORIES" <> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it'd be more consistent to just use "DIR"
.
Also, we might want to call this something like "searchDir", and clarify this in the help - something like "Directories which are searched for cabal files. If none specified, uses only the current directory."
LGTM, other than the comment. In general I'd prefer the formatting changes happening in a different commit, but it's no big deal. |
Ha, I didn't even notice those. I run stylish-haskell and those changes just happened on save. I will back them out before the final commit. |
Pinging @achernyak , how's it going? |
@mgsloan Sorry for the long delay. Things got a bit crazy at work the last couple weeks. I plan to wrap everything up this weekend with all your suggestions and get this pushed out. |
Sounds good! I'm just taking a look at all the open PRs! I'll try to get #1674 merged first, as otherwise we may need to resolve some tricky merge conflicts. |
7ef0ef2
to
cbb5d34
Compare
@mgsloan I rebased the branch to get rid of some of the big style changes present before. Also, now a list of directories can be passed in. |
Hey, sorry for the review delay. Are you sure this works? To me it looks like it invokes init on each of the subdirectories, which isn't what we want. |
No problem at all. I must have miss understood the exact ask here. I see two other options:
Let me know which is more aligned with what is expected. |
I think the main thing is that we only want to generate one stack.yaml, and so should only call
Right here, we want to search in the directories listed by the user. Searching in all subdirectories is controlled by |
Got it, so we are only searching the specified directories and ignoring the subdirectories of the provided directories. Then we run initProject on the first |
Well, we're trying to get a list of all the cabal files in the project |
I guess you don't need to change |
@harendra-kumar Thanks, that makes complete sense. Realy cleared up my understanding on this one. |
Just tested and I think this version should meet the behaviour described by @harendra-kumar. |
Sorry, I missed the update to path-io so I ran into some conflicts I didn't notice until after the push. It is all fixed now. |
Also bump to lts-5, since lts-4 used aeson-0.10
Fix withUnpackedTarball7z to find name of srcDir after unpacking commercialhaskell#1774
There will be breaking changes in version 1.0.0 that affect some functions that Stack uses, so it's better to have this upper bound for now.
@@ -35,13 +35,15 @@ import Network.HTTP.Client.Conduit (HasHttpManager) | |||
import Path | |||
import Path.IO | |||
import Stack.BuildPlan | |||
import Stack.Config (getSnapshots, | |||
makeConcreteResolver) | |||
import Stack.Config (getSnapshots, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This import is duplicated.
Functionally it looks good. I added a few minor comments. Can you address those and squash the changes into a single commit? Unrelated formatting changes are better done via separate commits. Though its fine for this one. |
@harendra-kumar Thanks for the detailed review, working on those changes now. I really need to turn off my |
@mgsloan Is this the rough behavior referred to in #1593?
After a confirmation I will add list behavior instead of single argument, and some clean up to how the arguments are handled.